import request from '../index';

const baseUrl = '/base-server';
const orderUrl = '/order-server';
const chargeUrl = '/charge-server';

// 用户管理
// 实时订单分页查询
export const URL_PAGINGUSERCURRENTORDERT = `${orderUrl}/currentOrderUser/pagingCurrentOrder`;
export const pagingUserCurrentOrder = (params: any, pages: any) => {
  return request({
    url: `${orderUrl}/currentOrderUser/pagingCurrentOrder`,
    params: { form: params, pages: pages },
  });
};

// 停止充电接口
export const queryStopCharge = (params: any) => {
  return request({
    url: `${chargeUrl}/cmd/query_stop_charge`,
    params: { form: params, successMsg: '停止充电成功！' },
  });
};

// 历史订单分页查询
export const URL_PAGINGUSERHISTORYORDERT = `${orderUrl}/historyOrderUser/pagingHistoryOrder`;
export const pagingUserHistoryOrder = (params: any, pages: any) => {
  return request({
    url: `${orderUrl}/historyOrderUser/pagingHistoryOrder`,
    params: { form: params, pages: pages },
  });
};

export const URL_GETHISTORYCHARGEDATA = `${chargeUrl}/chargeData/getHistoryChargeData`;
export const getHistoryChargeData = (params: any, pages: any) => {
  return request({
    url: `${chargeUrl}/chargeData/getHistoryChargeData`,
    params: { form: params, pages: pages },
  });
};

// 电桩运营
// 实时订单分页查询
export const URL_PAGINGCURRENTORDERT = `${orderUrl}/currentOrder/pagingCurrentOrder`;
export const pagingCurrentOrder = (params: any, pages: any) => {
  return request({
    url: `${orderUrl}/currentOrder/pagingCurrentOrder`,
    params: { form: params, pages: pages },
  });
};

// 实时订单详情
export const getCurrentOrder = (params: any) => {
  return request({
    url: `${orderUrl}/currentOrder/getCurrentOrder`,
    params: { form: params },
  });
};

// 实时订单转异常订单
export const changeAbnormal = (params: any) => {
  return request({
    url: `${orderUrl}/currentOrder/changeAbnormal`,
    params: { form: params, successMsg: '该订单已更改为待处理订单！' },
  });
};

// 历史订单分页查询
export const URL_PAGINGHISTORYORDERT = `${orderUrl}/historyOrder/pagingHistoryOrder`;
export const pagingHistoryOrder = (params: any, pages: any) => {
  return request({
    url: `${orderUrl}/historyOrder/pagingHistoryOrder`,
    params: { form: params, pages: pages },
  });
};

// 导出历史订单
export const EXPORT_HISTORYORDERUSER = `${orderUrl}/historyOrderUser/export`;

// 导出电站历史订单
export const EXPORT_HISTORYORDER = `${orderUrl}/historyOrder/export`;


// 历史订单详情
export const getHistoryOrder = (params: any) => {
  return request({
    url: `${orderUrl}/historyOrder/getHistoryOrder`,
    params: { form: params },
  });
};


// 补推订单
export const historyOrderRetrofit = (params: any) => {
  return request({
    url: `${orderUrl}/historyOrder/retrofit`,
    params: { form: params, successMsg: '1' },
  });
};

// 异常订单分页查询
export const URL_PAGINGABNORMALORDERT = `${orderUrl}/abnormalOrder/pagingAbnormalOrder`;
export const pagingAbnormalOrder = (params: any, pages: any) => {
  return request({
    url: `${orderUrl}/abnormalOrder/pagingAbnormalOrder`,
    params: { form: params, pages: pages },
  });
};

// 异常订单详情
export const getAbnormalOrder = (params: any) => {
  return request({
    url: `${orderUrl}/abnormalOrder/getAbnormalOrder`,
    params: { form: params },
  });
};

// 异常订单处理
export const abnormalOrderSave = (params: any) => {
  return request({
    url: `${orderUrl}/abnormalOrder/sava`,
    params: { form: params, successMsg: '1' },
  });
};

// 异常订单获取实收费用
export const getAbnormalDiscount = (params: any) => {
  return request({
    url: `${orderUrl}/abnormalOrder/getAbnormalDiscount`,
    params: { form: params, isLoading: false },
  });
};

// 历史订单充电过程数据-需求&输出
export const getHistoryChargeExtendData = (params: any) => {
  return request({
    url: `${chargeUrl}/chargeData/getHistoryChargeExtendData`,
    params: { form: params },
  });
};

// 待处理订单分页查询
export const URL_PAGINGUNPAIDORDERT = `${orderUrl}/unpaidOrder/pagingUnpaidOrder`;
export const pagingUnpaidOrder = (params: any, pages: any) => {
  return request({
    url: `${orderUrl}/unpaidOrder/pagingUnpaidOrder`,
    params: { form: params, pages: pages },
  });
};

// 处理订单详情
export const getUnpaidOrder = (params: any) => {
  return request({
    url: `${orderUrl}/unpaidOrder/getUnpaidOrder`,
    params: { form: params },
  });
};

// 待处理订单转历史订单
export const unpaidTurnHistoryOrder = (params: any) => {
  return request({
    url: `${orderUrl}/unpaidOrder/unpaidTurnHistoryOrder`,
    params: { form: params },
  });
};

// 历史订单充电过程分页列表数据
export const URL_GETHISTORYCHARGEPAGEDATA = `${chargeUrl}/chargeData/getHistoryChargePageData`;
export const getHistoryChargePageData = (params: any, pages: any) => {
  return request({
    url: `${chargeUrl}/chargeData/getHistoryChargePageData`,
    params: { form: params, pages: pages },
  });
};

// 分页查询占位订单
export const URL_PAGINGOCCUPYORDER = `${orderUrl}/occupyOrderUser/pagingOccupyOrder`;
export const pagingOccupyOrder = (params: any, pages: any) => {
  return request({
    url: `${orderUrl}/occupyOrderUser/pagingOccupyOrder`,
    params: { form: params, pages: pages },
  });
};

// 分页查询用户占位订单
export const URL_PAGINGOCCUPYORDERUSER = `${orderUrl}/occupyOrderUser/pagingOccupyOrderUser`;
export const pagingOccupyOrderUser = (params: any, pages: any) => {
  return request({
    url: `${orderUrl}/occupyOrderUser/pagingOccupyOrderUser`,
    params: { form: params, pages: pages },
  });
};

// 占位订单详情
export const getOccupyOrder = (params: any) => {
  return request({
    url: `${orderUrl}/occupyOrderUser/getOccupyOrder`,
    params: { form: params },
  });
};

// 实时占位订单手动处理
export const occupyOrderTurnOrder = (params: any) => {
  return request({
    url: `${orderUrl}/occupyOrderUser/occupyOrderTurnOrder`,
    params: { form: params },
  });
};

// 手动计算超时费用
export const getOverTimeCost = (params: any) => {
  return request({
    url: `${orderUrl}/occupyOrderUser/getOverTimeCost`,
    params: { form: params, isLoading: false },
  });
};

// 导出电站占位订单
export const EXPORT_OCCUPYORDER = `${orderUrl}/occupyOrderUser/export`;

// 导出用户占位订单
export const EXPORT_OCCUPYORDERUSER = `${orderUrl}/occupyOrderUser/exportUser`;

// 导出订单历史详情
export const EXPORT_HISTORYDATAUSER = `${chargeUrl}/chargeData/export`;

